﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sunboxsoft.Common;
using System.Data.SQLite;

namespace Sunboxsoft.ASMS.Client.Domain.Service
{
    public class DeliverService
    {
        /// <summary>
        /// 交付维修单，汽车出厂
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ServiceResult DeliverMaintenanceBill(Guid id)
        {
            WebRef.ASMSWebService service = RemoteInfo.GetASMSService();
            try
            {
                WebRef.ServiceResult result = service.DeliverMaintenanceBill(id);
                if (result.IsSuccess)
                {
                    return new ServiceResult();
                }
                return new ServiceResult(result.ErrorCode, result.Message);
            }
            catch (Exception ex)
            {
                return new ServiceResult(1, ex.Message);
            }
            finally
            {
                RemoteInfo.ReleaseASMSService(service);
            }
        }
    }
}
